import request from '@/utils/request';
import { AxiosPromise } from 'axios';
//知识库-应用：获取当前用户有权限的应用
export const aiqaWikiAppsAuthorized = (query?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/apps/authorized`,
    method: 'get',
    params: query
  });
};

//查询AI提问记录列表-历史记录
export const aiqaWikiRecordList = (query?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/record/list`,
    method: 'get',
    params: query
  });
};

//敏感词过滤
export const aiqaSensitiveCheckSensitive = (query?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/sensitive/check-sensitive`,
    method: 'post',
    data: query
  });
};

// 创建ai提问记录
export const aiqaWikiRecordCreate = (data?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/record`,
    method: 'post',
    data: data
  });
};

//更新AI提问记录
export const aiqaWikiRecordUpdate = (data?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/record`,
    method: 'put',
    data: data
  });
};

//删除AI提问记录
export const aiqaWikiRecordDelete = (ids?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/record/${ids}`,
    method: 'delete',
  });
};

//增加数量

export const aiqaWikiAppsCrCount = (data?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/apps/cr_count?appId=${data}`,
    method: 'post',
  });
};

// 获取知识库应用列表

export const aiqaWikiAppsGetAuthorizedByDataSetId = (data?: any): AxiosPromise<any[]> => {
  return request({
    url: `/aiqa/wiki/apps/getAuthorizedByDataSetId`,
    method: 'get',
    params:data
  });
};